package com.service.imp;
import com.mapper.UserMapper;
import com.pojo.User;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> All() {
        return userMapper.All();
    }

    @Override
    public List<User> findAll() {
        return userMapper.listAll();
    }

    @Transactional
    @Override
    public Integer insert(User user) {
        return userMapper.insert(user);
    }

    @Override
    public List<User> login(String account, String password) {
        return userMapper.login(account,password);
    }

    @Override
    public Integer updatephone(User user) {
        return userMapper.updatephone(user);
    }

    @Override
    public Integer updatepassword(User user) {
        return userMapper.updatePassword(user);
    }

    @Override
    public List<User> search(User user) {
        return userMapper.search(user);
    }

    @Override
    public Integer delete(Integer id) {
        return userMapper.delete(id);
    }

    @Override
    public Integer update(User user) {
        return userMapper.update(user);
    }

    @Override
    public Integer tianjia(User user) {
        return userMapper.tianjia(user);
    }


}
